fix(windows): default file edits to structured apply_patch#592
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9e48a6195
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| .unwrap_or("https://chatgpt.com/backend-api/".to_string()), | ||
| include_plan_tool: include_plan_tool.unwrap_or(false), | ||
| include_apply_patch_tool: include_apply_patch_tool.unwrap_or(false), | ||
| include_apply_patch_tool: include_apply_patch_tool.unwrap_or(cfg!(target_os = "windows")), |
There was a problem hiding this comment.
Wire the default apply_patch tool to an executor
On Windows this now enables the structured apply_patch tool by default, but the function-call dispatcher still has no "apply_patch" arm; I checked handle_function_call, where unknown names fall through to unsupported call: {name}. For any Windows session using a model with apply_patch_tool_type set, the advertised edit path will therefore fail as soon as the model calls apply_patch instead of applying the patch.
Useful? React with 👍 / 👎.
Summary
On Windows, default file edits should use the structured
apply_patchtool instead of relying on shell-script patch invocations.The existing Windows-specific handling already maps apply_patch to the function tool when it is enabled, because freeform/heredoc-style patch commands are unreliable in native Windows shells. However, shell-command model families can currently default to
shell_commandwithout exposing the dedicated apply_patch tool, which makes edits more likely to route through the less reliable shell path.This change:
Testing